<template>
    <div >
<!--      preview-->
        <mdEditor ref="editRef" :content.sync="taskcontent"
                  :mode="$props.preview">
        style="width: 666px"></mdEditor>
    </div>
</template>
<script>
import mdEditor from '../../components/mdEditor/index.vue'
export default {
    data() {
        return {
            taskcontent: ''
        }
    },
    components: {
        mdEditor
    },
  props: {
    preview: {
      type: [String],

    },
  },
    methods: {
        initByDialog(_data) {
            this.taskcontent = _data?.taskcontent;
            console.log('初始化edit content this.taskcontent :', this.taskcontent);


 this.$refs['editRef'].$data.editorValue=this.taskcontent

        },
        submitByDialog() {
            var taskcontent =  this.$refs['editRef'].$data.editorValue
            return { success: true, data: taskcontent }
        }
    }
}
</script>
